package com.biao.java8.demo.pojo;

import java.lang.reflect.Method;
import java.util.Arrays;

public class TestAnnotation {

    @MyAnnotation("hello")
    @MyAnnotation()
    public void show() {

    }

    public static void main(String[] args) throws NoSuchMethodException {
        Class<TestAnnotation> aClass = TestAnnotation.class;
        Method show = aClass.getMethod("show");
        MyAnnotation[] mas = show.getAnnotationsByType(MyAnnotation.class);
        Arrays.stream(mas).forEach(m -> System.out.println(m.value()));
    }
}
